#{extends 'main.html' /}
#{set title:'CoolSoft- Project Roles' /}
<h2>Project Roles:</h2>


#{list items:roles,as:'Role'}
   #{if !Role.title.equals('Project Member')}
   #{secure.check 'Delete Project Role'}
   <a href="javascript:showDialogHelper('Confirmation','Are you sure you want to delete this role? There are ${Role.user_project_roles.user.size()} user/s in this role',true,'@{Projects.deleteRole(Role.getEntityId(),projectId)}','prompt');" title="delete?">x</a>
   #{/secure.check}
    #{/if}
#{secure.check 'Edit the permissions of new/built-in roles in my project'}
<a href="@{Projects.showEditRole(Role.title,Role.getEntityId(),projectId,Role.getEntityId())}">${Role.title}</a></Option>
#{/secure.check}

 #{if controllers.Security.checkPermission('Edit the permissions of new/built-in roles in my project',project)==false}
${Role.title}
#{/if}
	<br></br>
#{/list}
		
<br></br>
#{secure.check 'Create Project Role'}
<a href=@{Projects.createRole(projectId)}>+ Add New Role</a>
#{/secure.check}
<br>